import { API_CONFIG } from "../config/index.js"
import  request from "../api/index.js"

export const getRolesList = () =>{
    /*
        {
            username: username,
            password: password
        }
        ==>简写位{username,password}
    */
    return request(API_CONFIG.getRolesListApi,{},"GET",2000)
}
export const getMenuTree = () =>{
    /*
        {
            username: username,
            password: password
        }
        ==>简写位{username,password}
    */
    return request(API_CONFIG.getMenuTreeApi,{},"GET",2000)
}

export const getRolesListInfoHandler = () =>{
    /*
        {
            username: username,
            password: password
        }
        ==>简写位{username,password}
    */
    return request(API_CONFIG.getRolesListInfoApi,{},"GET",2000)
}

export const addRolesListInfoHandler = (data) =>{
    return request(API_CONFIG.addRolesListInfoApi,data,"POST",2000)
}

export const updateRolesListInfoHandler = (id,data) =>{
    return request(API_CONFIG.updateRolesListInfoApi(id),data,"PUT",2000)
}

export const delRolesListInfoHandler = (id) =>{
    return request(API_CONFIG.delRolesListInfoApi(id),{},"DELETE",2000)
}

export const createRolesBindInfoHandler = (data) =>{
    return request(API_CONFIG.createRolesBindInfoApi,data,"POST",2000)
}
export const getRolesBindInfoHandler = (id) =>{
    return request(API_CONFIG.getRolesBindInfoApi(id),{},"GET",2000)
}
export const getUserRoleBindInfoHandler = (username) =>{
    return request(API_CONFIG.getUserRoleBindInfoApi(username),{},"GET",2000)
}